<html>
    <head> <style type="text/css">
        @import "../dojo-release-1.0.0/dojox/grid/_grid/tundraGrid.css";
        @import "../dojo-release-1.0.0/dijit/themes/tundra/tundra.css";
        @import "../dojo-release-1.0.0/dojo/resources/dojo.css"

                body {
                        font-size: 0.9em;
                        font-family: Geneva, Arial, Helvetica, sans-serif;
                }
                .heading {
                        font-weight: bold;
                        padding-bottom: 0.25em;
                }
                               
                #grid {
                        border: 1px solid #333;
                        width: 35em;
                        height: 30em;
                }
        </style>
	<script type="text/javascript" src="../dojo-release-1.0.0/dojo/dojo.js" djConfig="isDebug:false, parseOnLoad: true"></script>
	<script type="text/javascript">
		dojo.require("dojox.data.dom");
	</script>
        <script type="text/javascript" src="scripts/prototype.js">
        </script>
        <script type="text/javascript" src="scripts/ws.js">
        </script>
        <script type="text/javascript">
            function sayHello(name, container){
                var call = new WS.Call("http://localhost:8080/logistics-ws/services/BasicManageService");
                var nsuri = 'http://localhost:8080/';
                var qn_op = new WS.QName('getAllPlacevo', nsuri);
                var qn_op_resp = new WS.QName('getAllPlacevoResponse', nsuri);
                call.invoke_rpc(qn_op, new Array(), null, function(call, envelope){
                    var ret = envelope.get_body().get_all_children()[0].get_all_children()[0];
					var temOr="";
					
					var placeVOs = ret.get_all_children();
					//ret=ret.get_all_children()[1];//WlPlaceVO 
					alert(placeVOs.length);
					for (var j = 0; j < placeVOs.length; j++) {
						var placeVO=placeVOs[j].get_all_children();
						alert(placeVO.length);
						for (var i = 0; i < placeVO.length; i++) {
							alert(i);
							try{
								temOr = temOr+placeVO[i].get_value();
							}catch(x){}
						}
						temOr=temOr+"<br>";
					}
					/*for(var q=0;q<ret.length;q++){
						temOr=temOr+ret[q].get_value();
					}*/
					//var xmlDoc = dojox.data.dom.createDocument(ret);
                    //var voObjs = xmlDoc.getElementsByTagName('WlPlaceVO');
                    
					$('original').innerHTML= temOr;
					
					var temSt="";
					
					//for(i=0;i<voObjs.length;i++){
//						for (j in ret){
//							temSt=temSt+j+"()<br>";
//						}
						
					//}
					container.innerHTML = temSt;
					
					
					
                    $('soap').innerHTML = arguments[2].escapeHTML();
					
					//
					//var response = xmlDoc.getElementsByTagName("message");
                });
            }
        </script>
        <style>
            body {
                font-family: verdana;
            }
            
            #container {
                margin: 10pt;
                border: 1pt solid black;
                padding: 2pt;
            }
            #original {
                padding: 5pt;
                background-color: #00eeee;
            }
            
            #result {
                padding: 5pt;
                background-color: #eeeeee;
            }
            
            #soap {
                padding: 5pt;
                background-color: #eeee00;
                font-size: 10pt;
            }
        </style>
    </head>
    <body>
        <input name="name" id="name"/><input value="Invoke the Web Service" type="button" onclick="sayHello($('name').value,$('result'))"/>
        <div id="container">
            Result:
			 <div id="original">
            </div>
            <div id="result">
            </div>
            <div id="soap">
            </div>
        </div>
    </body>
</html>
